package com.zoe.onelink.upms.common.constants;

/**
 * <p>标题: </p>
 * <p>描述: </p>
 * <p>版权: Copyright (c) 2018</p>
 * <p>公司: 智业软件</p>
 *
 * @author LinHongKai
 * @date 2022-02-23 13:50
 */
public interface SecurityConstants {

    String HEADER_TOKEN = "onelinkToken";

    String GRANT_TYPE_PASSWORD = "password";

    String GRANT_TYPE_CA = "ca";

    String GRANT_TYPE_REFRESH_TOKEN = "refresh_token";

    String GRANT_TYPE_AUTHORIZATION_CODE = "authorization_code";

    String GRANT_TYPE_CLIENT_CREDENTIALS = "client_credentials";

    String GRANT_TYPE_QY_WECHAT = "qy_wechat";

    /**
     * 客户端ID
     */
    String CLIENT_ID = "clientId";

    /**
     * 机构编码
     */
    String ORG_CODE = "orgCode";

    /**
     * 院区编码
     */
    String DISTRICT_CODE = "districtCode";

    /**
     * 默认登录URL
     */
    String OAUTH_TOKEN_URL = "/oauth/token";

    /**
     * UPMS_CLIENT_DETAILS 表的字段，不包括client_id、client_secret
     */
    String CLIENT_FIELDS = "client_id, client_secret, resource_ids, scope, "
            + "authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, "
            + "refresh_token_validity, additional_information, autoapprove ";

    /**
     * JdbcClientDetailsService 查询语句
     */
    String BASE_FIND_STATEMENT = "select " + CLIENT_FIELDS + " from UPMS_CLIENT_DETAILS ";

    /**
     * 默认的查询语句
     */
    String DEFAULT_FIND_STATEMENT = BASE_FIND_STATEMENT + " order by client_id";

    /**
     * 按条件client_id 查询
     */
    String DEFAULT_SELECT_STATEMENT = BASE_FIND_STATEMENT + " where client_id = ?";

    /**
     * 授权服务器 ---提供给---> 资源服务器，获取用户认证信息的端点
     */
    String ENDPOINT_AUTH_READ_AUTHENTICATION = "/inner/auth/readAuth";

    /**
     * 授权服务器 ---提供给---> 资源服务器，获取用户权限标识集合的端点
     */
    String ENDPOINT_AUTH_READ_PERMISSIONS = "/inner/auth/readPermissions";

    /**
     * 授权服务器 ---提供给---> 资源服务器，对比redis是否同源的端点
     */
    String ENDPOINT_AUTH_REDIS_IS_EQUAL = "/inner/auth/redisIsEqual";

    /**
     * 资源服务器 ---提供给---> 授权服务器，清除本地TOKEN的端点
     */
    String ENDPOINT_CLIENT_CLEAN_TOKEN = "/inner/client/cleanToken";
    /**
     * 资源服务器 ---提供给---> 授权服务器，刷新本地redis用户信息的端点
     */
    String ENDPOINT_CLIENT_REFRESH_USER_INFO = "/inner/client/flushAuthInfo";
    /**
     * 资源服务器 ---提供给---> 授权服务器，刷新本地redis用户权限标识集合
     */
    String ENDPOINT_CLIENT_REFRESH_USER_PERMISSION = "/inner/client/flushPermission";



}
